package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.vo.ListIdsVo;
import com.mk.admin.model.vo.RRoleSysMenuBatchVo;
import com.mk.admin.service.RRoleSysMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/rRoleSysMenu")
@Api(tags = "关联-角色和系统菜单")
public class RRoleSysMenuController {
    @Autowired
    private RRoleSysMenuService rRoleSysMenuService;

    @PostMapping("/addBatch")
    @ApiOperation("批量增加当前角色的菜单")
    public ResultDto addBatch(@RequestBody RRoleSysMenuBatchVo vo) {
        return rRoleSysMenuService.addBatch(vo.getList());
    }

    @PostMapping("/deleteBatch")
    @ApiOperation("批量删除当前角色的菜单")
    public ResultDto deleteBatch(@RequestBody ListIdsVo list) {
        return rRoleSysMenuService.deleteBatch(list.getList());
    }
}
